<ot-view>

    <div class="ot-home-filter input-group col-md-4 form-inline">
        <input class="form-control"
               type="text"
               ng-model="filterToken"
               placeholder="Filter on validation stamp names"/>
        <span class="input-group-addon"><span class="fa fa-filter"></span></span>
    </div>

    <table class="table table-hover" ng-if="predefinedValidationStamps.resources">
        <thead>
            <tr>
                <th>Name</th>
                <th>Type</th>
                <th>Description</th>
                <th>&nbsp;</th>
            </tr>
        </thead>
        <tbody>
        <tr ng-repeat="predefinedValidationStamp in predefinedValidationStamps.resources | filter: {name: filterToken}">
            <td>
                <ot-entity-image entity="predefinedValidationStamp">
                    {{predefinedValidationStamp.name}}
                </ot-entity-image>
            </td>
            <td>
                <div ng-if="predefinedValidationStamp.dataType">
                    <p class="ot-description">{{predefinedValidationStamp.dataType.descriptor.displayName}}</p>
                    <ot-validation-data-type-config value="predefinedValidationStamp.dataType"></ot-validation-data-type-config>
                </div>
                <div ng-if="!predefinedValidationStamp.dataType">
                    <span class="ot-description">Normal</span>
                </div>
            </td>
            <td>
                {{predefinedValidationStamp.description}}
            </td>
            <td>
                <span
                        class="fa fa-image ot-command"
                        ng-click="editValidationStampImage(predefinedValidationStamp)"
                        title="Edits the image for the {{predefinedValidationStamp.name}} validation stamp"></span>
                <span
                        class="fa fa-pencil ot-command"
                        ng-click="editValidationStamp(predefinedValidationStamp)"
                        title="Edits the name or description for the {{predefinedValidationStamp.name}} validation stamp"></span>
                <span
                        class="fa fa-trash ot-command"
                        ng-click="deleteValidationStamp(predefinedValidationStamp)"
                        title="Deletes the {{predefinedValidationStamp.name}} validation stamp"></span>
            </td>
        </tr>
        </tbody>
    </table>

    <div class="row" ng-hide="predefinedValidationStamps.resources">
        <div class="col-md-12">
            <div class="alert alert-warning">
                No predefined validation stamp has been created yet.
            </div>
        </div>
    </div>

</ot-view>